#ifndef _CUDA_CONV2_CUH_
#define _CUDA_CONV2_CUH_

#include "cuda_conv2_full.cu"
#include "cuda_conv2_r_valid.cu"
#include "cuda_conv2_r_big_filter.cu"

/*
   interface of convolution by cuda.
   the template parameter specify the store method
   
   see also "cuda_store_method.cuh"
            "..\base\cuda_map.cuh"
*/
namespace cuda_matrix{
    /* conv2 ans = mat * ~filter */
    template<int map_m,int sm>
    inline void conv2_r_valid( Mat ans,
                               const Mat mat,
                               const Mat filter ){
        conv2_r_valid_A<map_m,sm>( ans, mat, filter );
    }

    /* group conv2 ans = mat * ~filter */
    template<int map_m,int sm>
    inline void conv2_r_valid( Mat3D ans,
                               const Mat3D mat,
                               const Mat4D filter ){
        conv2_r_valid_3DGrid<map_m,sm>( ans, mat, filter );
    }
    
    template<int map_m,int sm>
    inline void conv2_r_valid( Mat3D ans,
                               const Mat3D mat,
                               const Mat4DBias filter ){
        conv2_r_valid_3DGrid<map_m,sm>( ans, mat, filter );
    }

    template<int map_m,int sm>
    inline void conv2_full( Mat ans,
                            const Mat mat,
                            const Mat filter ){
        conv2_full_A<map_m,sm>( ans, mat, filter );
    }

    template<int map_m,int sm>
    inline void conv2_full( Mat3D ans,
                            const Mat3D mat,
                            const Mat4D filter ){
        conv2_full_3DGrid<map_m,sm>( ans, mat, filter );
    }

    template<int map_m,int sm>
    inline void conv2_full( Mat3D ans,
                            const Mat3D mat,
                            const Mat4DBias filter ){
        conv2_full_3DGrid<map_m,sm>( ans, mat, filter );
    }

    template<int map_m,int sm>
    inline void conv2_r_big_filter( Mat ans,
                                    const Mat mat,
                                    const Mat filter ){
        conv2_r_big_filter_B<map_m,sm>( ans, mat, filter );
    }

    template<int map_m,int sm>
    inline void conv2_r_big_filter( Mat4D ans,
                                    const Mat3D mat,
                                    const Mat3D filter ){
        conv2_r_big_filter_C_Grid<map_m,sm>( ans, mat, filter );
    }
    
    template<int map_m,int sm>
    inline void conv2_r_big_filter( Mat4DBias ans,
                                    const Mat3D mat,
                                    const Mat3D filter ){
        conv2_r_big_filter_C_Grid<map_m,sm>( ans, mat, filter );
    }
};

#endif


